import request from '@/utils/request'

// 查询公交车辆列表
export function listVehicle(query) {
    return request({
        url: '/bus/vehicle/list',
        method: 'get',
        params: query
    })
}

// 查询公交车辆详细
export function getVehicle(id) {
    return request({
        url: '/bus/vehicle/' + id,
        method: 'get'
    })
}

// 新增公交车辆
export function addVehicle(data) {
    return request({
        url: '/bus/vehicle',
        method: 'post',
        data: data
    })
}

// 修改公交车辆
export function updateVehicle(data) {
    return request({
        url: '/bus/vehicle',
        method: 'put',
        data: data
    })
}

// 删除公交车辆
export function delVehicle(id) {
    return request({
        url: '/bus/vehicle/' + id,
        method: 'delete'
    })
}

// 获取弹窗select数据
export function getSelectData() {
    return request({
        url: '/bus/line/selectData',
        method: 'post',
    })
}

// 获取机具编号
export function getMachineryNumber(machineryCompanyId) {
    return request({
        url: '/bus/vehicle/getMachineryNumber/'+machineryCompanyId,
        method: 'get',
    })
}

// 改状态
export function changeStatus(data) {
    return request({
        url: '/bus/vehicle/changeStatus',
        method: 'post',
        data: data
    })
}

